import { lazy } from "react";

let ruterlink=[
    {
        path:'/home/index',
        element:lazy(()=>import('../views/home/Index'))
    },
    {
        path:'/home/order',
        element:lazy(()=>import('../views/home/Order'))
    },
    {
        path:'/home/customer',
        element:lazy(()=>import('../views/home/Customer'))
    },
    {
        path:'/home/my',
        element:lazy(()=>import('../views/home/My'))
    },
]

const routes=[
    {
        path:'/',
        to:'/home/index'
    },
    {
        path:'/home',
        element:lazy(()=>import('../views/Home')),
        children:ruterlink
    },
    {
        path:'/login',
        element:lazy(()=>import('../views/Login')),
    },
    {
        path:'/register',
        element:lazy(()=>import('../views/register')),
    },
    {
        path:'/add',
        element:lazy(()=>import('../views/add')),
    },
    {
        path:'/detail',
        element:lazy(()=>import('../views/Detail')),
    },
]

export default routes
